package com.ktjy.lot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ktjy.lot.mapper.TaskInfoMapper;
import com.ktjy.lot.pojo.TaskInfo;
import com.ktjy.lot.service.TaskInfoService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class TaskInfoServiceImp implements TaskInfoService {

    @Resource
    TaskInfoMapper taskInfoMapper;

    public int isTaskEnabled(String taskName) {
        QueryWrapper<TaskInfo> wrapper = new QueryWrapper<>();
        wrapper.eq("task_name", taskName);
        TaskInfo o = taskInfoMapper.selectOne(wrapper);
        Integer enabled = o.getEnabled();
        return enabled;
    }
}
